home *** CD-ROM | disk | FTP | other *** search
- /* Example ARexx script for ClipHistory 2.0+.
- *
- * Restores a previously dumped history from a drawer.
- */
-
- OPTIONS RESULTS
- ADDRESS CLIPHISTORY0
-
- /* Change this to your drawer. Remember to include a terminating ':' or '/'.
- * This should match your setting in Dump.cliph
- */
- Drawer = 'Ram:'
-
- Lf = '0a'x
-
- /* Any entries in the history? */
- HistoryInfo
-
- IF Word( RESULT, 1 ) ~= '0' THEN DO
- RequestResponse PROMPT '"Should the current clips be removed first?"'
-
- IF RC = 0 THEN DO
- DeleteAllItems FORCE
- END
- END
-
- /* There will never be more than 32767 clips in the history.
- * Also, we will exit the loop when we don't find any more files.
- */
- DO i = 1 TO 32767
- /* This line requires rexxsupport.library to be available */
- IF ~Exists( Drawer'ClipHistory.'i ) THEN DO
- /* No more clips, it seems */
- LEAVE i
- END
-
- /* This is really a tad inefficient, as the clips are loaded via
- * the clipboard, and not directly into the history. Oh well...
- */
- PutFile Drawer'ClipHistory.'i
-
- IF RC ~= 0 THEN DO
- RequestResponse PROMPT '"Error restoring clip # 'i' (RC2='RC2')!'Lf'Continue loading clips?"'
-
- IF RC = 0 THEN DO
- LEAVE i
- END
- END
- END
-
- RequestNotify '"Restored 'i - 1' clips from 'Drawer'."'
-